{ Error Codes [Speech recognition gets -5100 through -5199] }
kSRNotAvailable = -5100; { the service requested is not avail or applicable }
kSRInternalError = -5101; { a system internal or hardware error condition }
kSRComponentNotFound = -5102; { a needed system resource was not located }
kSROutOfMemory = -5103; { an out of memory error occurred in the toolbox memory space }
kSRNotASpeechObject = -5104; { the object specified is no longer or never was valid }
kSRBadParameter = -5105; { an invalid parameter was specified }
kSRParamOutOfRange = -5106; { when we say 0-100, don't pass in 101. }
kSRBadSelector = -5107; { an unrecognized selector was specified }
kSRBufferTooSmall = -5108; { returned from attribute access functions }
kSRNotARecSystem = -5109; { the object used was not a SRRecognitionSystem }
kSRFeedbackNotAvail = -5110; { there is no feedback window associated with SRRecognizer }
kSRCantSetProperty = -5111; { a non-settable property was specified }
kSRCantGetProperty = -5112; { a non-gettable property was specified }
kSRCantSetDuringRecognition = -5113; { the property can't be set while recognition is in progress -- do before or between utterances. }
kSRAlreadyListening = -5114; { in response to SRStartListening }
kSRNotListeningState = -5115; { in response to SRStopListening }
kSRModelMismatch = -5116; { no acoustical models are avail to match request }
kSRNoClientLanguageModel = -5117; { trying to access a non-specified SRLanguageModel }
kSRNoPendingUtterances = -5118; { nothing to continue search on }
kSRRecognitionCanceled = -5119; { an abort error occurred during search }
kSRRecognitionDone = -5120; { search has finished, but nothing was recognized }
kSROtherRecAlreadyModal = -5121; { another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now }
kSRHasNoSubItems = -5122; { SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. }
kSRSubItemNotFound = -5123; { returned when accessing a non-existent sub item of a container }
kSRLanguageModelTooBig = -5124; { Cant build language models so big }
kSRAlreadyReleased = -5125; { this object has already been released before }
kSRAlreadyFinished = -5126; { the language model can't be finished twice }
kSRWordNotFound = -5127; { the spelling couldn't be found in lookup(s) }
kSRNotFinishedWithRejection = -5128; { property not found because the LMObj is not finished with rejection }
kSRExpansionTooDeep = -5129; { Language model is left recursive or is embedded too many levels }
kSRTooManyElements = -5130; { Too many elements added to phrase or path or other langauge model object }
kSRCantAdd = -5131; { Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject) }
kSRSndInSourceDisconnected = -5132; { Sound input source is disconnected }
kSRCantReadLanguageObject = -5133; { An error while trying to create new Language object from file or pointer -- possibly bad format }
{ non-release debugging error codes are included here }
kSRNotImplementedYet = -5199; { you'd better wait for this feature in a future release }
{ Type Definitions }
TYPE
SRSpeechObject = ^LONGINT;
SRRecognitionSystem = SRSpeechObject;
SRRecognizer = SRSpeechObject;
SRSpeechSource = SRSpeechObject;
SRRecognitionResult = SRSpeechSource;
SRLanguageObject = SRSpeechObject;
SRLanguageModel = SRLanguageObject;
SRPath = SRLanguageObject;
SRPhrase = SRLanguageObject;
SRWord = SRLanguageObject;
{ between 0 and 100 }
SRSpeedSetting = INTEGER;
{ between 0 and 100 }
SRRejectionLevel = INTEGER;
{ When an event occurs, the user supplied proc will be called with a pointer }
{ to the param passed in and a flag to indicate conditions such }
{ as interrupt time or system background time. }
SRCallBackStructPtr = ^SRCallBackStruct;
SRCallBackStruct = RECORD
what: LONGINT; { one of notification flags }
message: LONGINT; { contains SRRecognitionResult id }
instance: SRRecognizer; { ID of recognizer being notified }
status: OSErr; { result status of last search }
flags: INTEGER; { non-zero if occurs during interrupt }
refCon: LONGINT; { user defined - set from SRCallBackParam }
kSRNotifyRecognitionBeginning = $00000001; { recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition }
kSRNotifyRecognitionDone = $00000002; { recognition has terminated. result (if any) is available. }
{ Apple Event selectors }
{ AppleEvent message class }
kAESpeechSuite = 'sprc';
{ AppleEvent message event ids }
kAESpeechDone = 'srsd';
kAESpeechDetected = 'srbd';
{ AppleEvent Parameter ids }
keySRRecognizer = 'krec';
keySRSpeechResult = 'kspr';
keySRSpeechStatus = 'ksst';
{ AppleEvent Parameter types }
typeSRRecognizer = 'trec';
typeSRSpeechResult = 'tspr';
{ SRRecognizer Properties }
kSRNotificationParam = 'noti'; { see notification flags below }
kSRCallBackParam = 'call'; { type SRCallBackParam }
kSRSearchStatusParam = 'stat'; { see status flags below }
kSRAutoFinishingParam = 'afin'; { automatic finishing applied on LM for search }
kSRForegroundOnly = 'fgon'; { Boolean. Default is true. If true, client recognizer only active when in foreground. }
kSRBlockBackground = 'blbg'; { Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive. }
kSRBlockModally = 'blmd'; { Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! }
kSRWantsResultTextDrawn = 'txfb'; { Boolean. Default is true. If true, search results are posted to Feedback window }
kSRWantsAutoFBGestures = 'dfbr'; { Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior }
kSRSoundInVolume = 'volu'; { short in [0..100] log scaled sound input power. Can't set this property }
kSRReadAudioFSSpec = 'aurd'; { *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF }
kSRCancelOnSoundOut = 'caso'; { Boolean: Default is true. If any sound is played out during utterance, recognition is aborted. }
kSRSpeedVsAccuracyParam = 'sped'; { SRSpeedSetting between 0 and 100 }
{ 0 means more accurate but slower. }
{ 100 means (much) less accurate but faster. }
kSRUseToggleListen = 0; { listen key modes }
kSRUsePushToTalk = 1;
kSRListenKeyMode = 'lkmd'; { short: either kSRUseToggleListen or kSRUsePushToTalk }
kSRListenKeyCombo = 'lkey'; { short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message }